<?php namespace Siyuanliu\Filmcms\Models;

use Model;

/**
 * film Model
 */
class Film extends Model
{
    use \October\Rain\Database\Traits\Nullable;

    /**
     * @var array Nullable attributes.
     */
    protected $nullable = ['want,description,watched,scores,scoresNum,resources'];
    /**
     * @var string The database table used by the model.
     */
    public $table = 'siyuanliu_filmcms_films';
    protected $jsonable = ['resources'];
    /**
     * @var array Guarded fields
     */
    protected $guarded = ['*'];

    /**
     * @var array Fillable fields
     */
    protected $fillable = [];

    /**
     * @var array Relations
     */
    public $hasOne = [];
    public $hasMany = [
      // 'resources' => 'Siyuanliu\Filmcms\Models\Resource',
      'actors' => 'Siyuanliu\Filmcms\Models\Actor'
    ];
    public $belongsTo = [];
    public $belongsToMany = [
      'categories' => [
          'Siyuanliu\Filmcms\Models\Category',
          'table' => 'siyuanliu_filmcms_films_categories',
          'order' => 'title'
      ]
    ];
    public $morphTo = [];
    public $morphOne = [];
    public $morphMany = [];
    public $attachOne = [
      'avatar' => ['System\Models\File', 'public' => true]
    ];
    public $attachMany = [];
}
